<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
<div id="app">
	<button @click="add">+</button>
	<span>{{n}}</span>
	<button @click="minus">-</button>
</div>

<script src="js/vue.js"></script>
<script>
	new Vue({
        el:"#app",
        data:{
            n:0
        },
        methods:{
            add(){
                this.n++;
            },
            minus(){
                if (this.n>0) this.n--;
            }
        }
    });

</script>
</body>
</html>